home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
4dos
/
4dos_btm.zip
/
RD_FIL.BTM
< prev
Wrap
Text File
|
1992-02-27
|
2KB
|
89 lines
: *** RD_FIL.btm *** ReaD FILe * rhc december 91 * (v 2.0)
if %1! == ! goto ERROR ~ if %1 == ? goto SYNTAX
if %2! == ! .or. %3! == ! goto ERROR
iff %@index[0123456789,%@substr[%2, 0, 1]] ne -1 then
goto CONT
else
goto ERROR
endiff
:SYNTAX
gosub *_row ~ screen %row% 0
text
syntax: RD_FIL t_fil f_ln t_str
(t_fil: Target FiLe
f_ln : First LiNe [- 1] to be read
t_str: Target STRing)
endtext
goto END
:CONT
set f_nam=%1
set ln_no=%2
iff %ln_no% gt %@lines[%f_nam%] then
gosub *_row ~ screen %row% 1
echo Your %@upper[%f_nam%] has the wrong format, mate !!
set err_flg=1 ~ goto OUT
endiff
:*_read
set f_line=%@line[%f_nam%, %ln_no%]
iff "%f_line%" == "%3" then
set f_line=%@substr[%@line[%f_nam%, %@eval[%ln_no% + 1]], 0, 32]
set e_stt=%@eval[%@index[%f_line%,.] + 1]
set ext=%@substr[%f_line%, %e_stt%, 3]
iff %@index[%ext%, ] ne -1 then
set pos_bl=%@index[%ext%, ]
set ext=%@substr[%ext%, 0, %@eval[2 - %pos_bl%]]
endiff
goto OUT
else
set ln_no=%@eval[%ln_no% + 1] ~ goto *_read
endiff
:ERROR
gosub *_row ~ screen %row% 1
echo Try again, mate! This programme has the syntax described below.
goto SYNTAX
:*_row
set row=%@eval[%_row + 1]
iff %row% ge %_rows then
cls
set row=2
goto *_row
endiff
return
:OUT
set e_len=
set e_stt=
set f_line=
set f_nam=
set ln_no=
set pos_bl=
:END
set row=